<#if !Session['proj_creater']> <#assign message="您无法新建项目"> <#include "ftl-lib/warning.ftl"> <#else> <@t.header>
<link rel="stylesheet" href="${request.contextPath}/app/project/css/form.css">
</@t.header> <@t.body>
<div class="container suredy-form" style="padding-top: 60px;">
	<div class="navbar navbar-default navbar-fixed-top">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#suredy-form-navbar">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="#" style="border-right: 1px solid #ddd;">
				<i class="icon-tag"></i>
				新建项目
			</a>
		</div>
		<div class="collapse navbar-collapse" id="suredy-form-navbar">
			<ul class="nav navbar-nav suredy-form-bar">
				<li>
					<a href="#" class="new-project">
						<i class="icon-plus icon-large text-primary"></i>
						新建
					</a>
				</li>
				<li>
					<a href="#">
						<i class="icon-undo icon-large text-danger"></i>
						重置
					</a>
				</li>
			</ul>
		</div>
	</div>
	<div role="tabpanel" class="suredy-tabs">
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" class="active">
				<a class="bg-primary text-primary" href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab">项目信息</a>
			</li>
		</ul>

		<div class="tab-content" style="border: 1px solid #ddd; border-top: none;">
			<div role="tabpanel" class="tab-pane active" id="tab1">
				<form class="proj-form" style="padding: 10px 5px 0 5px;">
					<div class="row">
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #dff0d8;">
										<div class="title-content">
											<span class="text-danger">*</span>
											项目名称
										</div>
									</div>
									<input type="text" class="form-control" name="name" placeholder="最多60个汉字">
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #dff0d8;">
										<div class="title-content">
											<span class="text-danger">*</span>
											项目编号
										</div>
									</div>
									<input type="text" class="form-control" name="no" placeholder="最多30个字符">
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #dff0d8;">
										<div class="title-content">
											<span class="text-danger">*</span>
											项目类型
										</div>
									</div>
									<select class="form-control" name="type">
										<#if type??> <#list type as t>
										<option value="${t}">${t}</option>
										</#list> </#if>
									</select>
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #dff0d8;">
										<div class="title-content">起获方式</div>
									</div>
									<select class="form-control" name="obtainType">
										<option value="">==请选择==</option>
										<#if obtain??> <#list obtain as o>
										<option value="${o}">${o}</option>
										</#list> </#if>
									</select>
								</div>
							</div>
						</div>
						<div class="col-md-12 col-sm-12 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #dff0d8;">
										<div class="title-content">备注</div>
									</div>
									<textarea class="form-control" name="des" rows="5" placeholder="最多150个汉字"></textarea>
								</div>
							</div>
						</div>
						<div class="col-md-12 col-sm-12 col-xs-12">
							<hr style="margin-top: 0; border-color: #ddd;">
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #f2dede; color: #a94442;">
										<div class="title-content">
											<span class="text-danger">*</span>
											客户单位
										</div>
									</div>
									<select class="form-control" name="customerCompany">
										<#list customerCompany as cc>
										<option value="${cc}">${cc}</option>
										</#list>
									</select>
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #f2dede; color: #a94442;">
										<div class="title-content">客户部门</div>
									</div>
									<input type="text" class="form-control" name="customerUnit" placeholder="最多30个字符">
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #f2dede; color: #a94442;">
										<div class="title-content">联系人</div>
									</div>
									<input type="text" class="form-control" name="customerPeople" placeholder="最多10个汉字">
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-12">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon" style="background-color: #f2dede; color: #a94442;">
										<div class="title-content">联系电话</div>
									</div>
									<input type="text" class="form-control" name="customerPhone" placeholder="最多15个数字">
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
</@t.body> <@t.foot>
<script src="${request.contextPath}/core/js/jquery.form.js"></script>
<script type="text/javascript">
	$(function() {
		$('.new-project').on('click', function(event) {
			$('form.proj-form').ajaxSubmit({
				url : 'form/new',
				type : 'post',
				success : function(id, textStatus, jqXHR) {
					if (!id) {
						alert('创建项目失败！');
						return false;
					}

					window.location.href = 'form?id=' + id;
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert('创建项目失败！\n' + errorThrown);
				}
			});
		});
	});
</script>
</@t.foot> </#if>
